package b.g.b.h.l;

import b.g.b.h.a;
import b.g.b.h.d;

/* compiled from: HelperReferences */
public class j extends o {
    public j(d dVar) {
        super(dVar);
    }

    public void a(d dVar) {
        a aVar = (a) this.b;
        int i = aVar.n0;
        int i2 = 0;
        int i3 = -1;
        for (f fVar : this.h.l) {
            int i4 = fVar.g;
            if (i3 == -1 || i4 < i3) {
                i3 = i4;
            }
            if (i2 < i4) {
                i2 = i4;
            }
        }
        if (i == 0 || i == 2) {
            this.h.c(i3 + aVar.p0);
        } else {
            this.h.c(i2 + aVar.p0);
        }
    }

    public void d() {
        d dVar = this.b;
        if (dVar instanceof a) {
            f fVar = this.h;
            fVar.b = true;
            a aVar = (a) dVar;
            int i = aVar.n0;
            boolean z = aVar.o0;
            int i2 = 0;
            d dVar2;
            if (i == 0) {
                fVar.e = f.a.LEFT;
                while (i2 < aVar.m0) {
                    dVar2 = aVar.l0[i2];
                    if (z || dVar2.c0 != 8) {
                        fVar = dVar2.d.h;
                        fVar.k.add(this.h);
                        this.h.l.add(fVar);
                    }
                    i2++;
                }
                m(this.b.d.h);
                m(this.b.d.i);
            } else if (i == 1) {
                fVar.e = f.a.RIGHT;
                while (i2 < aVar.m0) {
                    dVar2 = aVar.l0[i2];
                    if (z || dVar2.c0 != 8) {
                        fVar = dVar2.d.i;
                        fVar.k.add(this.h);
                        this.h.l.add(fVar);
                    }
                    i2++;
                }
                m(this.b.d.h);
                m(this.b.d.i);
            } else if (i == 2) {
                fVar.e = f.a.TOP;
                while (i2 < aVar.m0) {
                    dVar2 = aVar.l0[i2];
                    if (z || dVar2.c0 != 8) {
                        fVar = dVar2.e.h;
                        fVar.k.add(this.h);
                        this.h.l.add(fVar);
                    }
                    i2++;
                }
                m(this.b.e.h);
                m(this.b.e.i);
            } else if (i == 3) {
                fVar.e = f.a.BOTTOM;
                while (i2 < aVar.m0) {
                    dVar2 = aVar.l0[i2];
                    if (z || dVar2.c0 != 8) {
                        fVar = dVar2.e.i;
                        fVar.k.add(this.h);
                        this.h.l.add(fVar);
                    }
                    i2++;
                }
                m(this.b.e.h);
                m(this.b.e.i);
            }
        }
    }

    public void e() {
        d dVar = this.b;
        if (dVar instanceof a) {
            int i = ((a) dVar).n0;
            if (i == 0 || i == 1) {
                dVar.U = this.h.g;
            } else {
                dVar.V = this.h.g;
            }
        }
    }

    public void f() {
        this.c = null;
        this.h.b();
    }

    public boolean k() {
        return false;
    }

    public final void m(f fVar) {
        this.h.k.add(fVar);
        fVar.l.add(this.h);
    }
}
